﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ch05
{
    class Class6
    {
        static void Main(string[] args)
        {
            //定义数组并赋初始值
            int[] score = { 68, 79, 98, 75, 67 };

            //调用Array类的Sort方法对数组进行排序(默认的是升序)
            Array.Sort(score);

            Console.Write("排序后：");
            foreach (int s in score)
            {
                Console.Write(s + "\t");
            }
            Console.WriteLine();

            //调用Array类的Reverse方法对数组进行反序
            Array.Reverse(score);

            Console.Write("反序后：");
            foreach (int s in score)
            {
                Console.Write(s + "\t");
            }
            Console.WriteLine("\n");

        }
    }
}
